package com.atguigu.lease.common.bloomFilter;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

public class HashStrategyFactory {

    private static final Map<String, HashStrategy> STRATEGY_MAP = new HashMap<>();

    static {
        STRATEGY_MAP.put("simple", new SimpleHashStrategy());
        STRATEGY_MAP.put("murmur", new MurmurHashStrategy());
    }

    public static HashStrategy getStrategy(String type) {
        return STRATEGY_MAP.getOrDefault(type, STRATEGY_MAP.get(type));
    }
}
